<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>

<body>
    <div id="app">
        <button v-on:click="fn(1)">点我</button>
    </div>
    <script>
        new Vue({
            el: "#app",
            methods: {
                fn(index) {
                    console.log(index)
                }
            },
        })
    </script>
</body>

</html>